<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>transwarp: transwarp::detail::circular_buffer&lt; ValueType &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">transwarp
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacetranswarp.html">transwarp</a></li><li class="navelem"><a class="el" href="namespacetranswarp_1_1detail.html">detail</a></li><li class="navelem"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classtranswarp_1_1detail_1_1circular__buffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">transwarp::detail::circular_buffer&lt; ValueType &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A simple circular buffer (FIFO). ValueType must support default construction. The buffer lets you push new values onto the back and pop old values off the front.  
 <a href="classtranswarp_1_1detail_1_1circular__buffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="transwarp_8h_source.html">transwarp.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a4fada31a8773ec0027905ad45806ef3d"><td class="memItemLeft" align="right" valign="top"><a id="a4fada31a8773ec0027905ad45806ef3d"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>value_type</b> = ValueType</td></tr>
<tr class="separator:a4fada31a8773ec0027905ad45806ef3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a13fa676f234b0c1ecceb40977b2cc540"><td class="memItemLeft" align="right" valign="top"><a id="a13fa676f234b0c1ecceb40977b2cc540"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a13fa676f234b0c1ecceb40977b2cc540">circular_buffer</a> (std::size_t <a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a5111912d5d003d2e1fa2b471cdb2705c">capacity</a>)</td></tr>
<tr class="memdesc:a13fa676f234b0c1ecceb40977b2cc540"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a circular buffer with a given fixed capacity. <br /></td></tr>
<tr class="separator:a13fa676f234b0c1ecceb40977b2cc540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5395436eadc3fb8fa1b62114ad7f4f8"><td class="memItemLeft" align="right" valign="top"><a id="ab5395436eadc3fb8fa1b62114ad7f4f8"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>circular_buffer</b> (const <a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;)=delete</td></tr>
<tr class="separator:ab5395436eadc3fb8fa1b62114ad7f4f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11f434f2ad2f9b28ef80d6d61db57f74"><td class="memItemLeft" align="right" valign="top"><a id="a11f434f2ad2f9b28ef80d6d61db57f74"></a>
<a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;)=delete</td></tr>
<tr class="separator:a11f434f2ad2f9b28ef80d6d61db57f74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a225ba9a8bde1c4744a594bbdc2487c"><td class="memItemLeft" align="right" valign="top"><a id="a5a225ba9a8bde1c4744a594bbdc2487c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>circular_buffer</b> (<a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a5a225ba9a8bde1c4744a594bbdc2487c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d5ac21ecbd5c1288cd8703b66128198"><td class="memItemLeft" align="right" valign="top"><a id="a4d5ac21ecbd5c1288cd8703b66128198"></a>
<a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;&amp;)=delete</td></tr>
<tr class="separator:a4d5ac21ecbd5c1288cd8703b66128198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6916fa11beb3f28e7bcf70652084a1dc"><td class="memTemplParams" colspan="2"><a id="a6916fa11beb3f28e7bcf70652084a1dc"></a>
template&lt;typename T , typename  = typename std::enable_if&lt;std::is_same&lt;typename std::decay&lt;T&gt;::type, value_type&gt;::value&gt;::type&gt; </td></tr>
<tr class="memitem:a6916fa11beb3f28e7bcf70652084a1dc"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a6916fa11beb3f28e7bcf70652084a1dc">push</a> (T &amp;&amp;value)</td></tr>
<tr class="memdesc:a6916fa11beb3f28e7bcf70652084a1dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushes a new value onto the end of the buffer. If that exceeds the capacity of the buffer then the oldest value gets dropped (the one at the front). <br /></td></tr>
<tr class="separator:a6916fa11beb3f28e7bcf70652084a1dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0554996ee4e6ed5bf9b911df608af0b"><td class="memItemLeft" align="right" valign="top"><a id="ad0554996ee4e6ed5bf9b911df608af0b"></a>
const value_type &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#ad0554996ee4e6ed5bf9b911df608af0b">front</a> () const</td></tr>
<tr class="memdesc:ad0554996ee4e6ed5bf9b911df608af0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value at the front of the buffer (the oldest value). This is undefined if the buffer is empty. <br /></td></tr>
<tr class="separator:ad0554996ee4e6ed5bf9b911df608af0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39a69e7aac3dd7bf145db7266f20f72a"><td class="memItemLeft" align="right" valign="top"><a id="a39a69e7aac3dd7bf145db7266f20f72a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a39a69e7aac3dd7bf145db7266f20f72a">pop</a> ()</td></tr>
<tr class="memdesc:a39a69e7aac3dd7bf145db7266f20f72a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the value at the front of the buffer (the oldest value) <br /></td></tr>
<tr class="separator:a39a69e7aac3dd7bf145db7266f20f72a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5111912d5d003d2e1fa2b471cdb2705c"><td class="memItemLeft" align="right" valign="top"><a id="a5111912d5d003d2e1fa2b471cdb2705c"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a5111912d5d003d2e1fa2b471cdb2705c">capacity</a> () const</td></tr>
<tr class="memdesc:a5111912d5d003d2e1fa2b471cdb2705c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the capacity of the buffer. <br /></td></tr>
<tr class="separator:a5111912d5d003d2e1fa2b471cdb2705c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f738f3ba4d3b4a719a27d6fc0e96432"><td class="memItemLeft" align="right" valign="top"><a id="a1f738f3ba4d3b4a719a27d6fc0e96432"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a1f738f3ba4d3b4a719a27d6fc0e96432">size</a> () const</td></tr>
<tr class="memdesc:a1f738f3ba4d3b4a719a27d6fc0e96432"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of populated values of the buffer. Its maximum value equals the capacity of the buffer. <br /></td></tr>
<tr class="separator:a1f738f3ba4d3b4a719a27d6fc0e96432"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab36e5cdf86450fca871dfbfab08deb21"><td class="memItemLeft" align="right" valign="top"><a id="ab36e5cdf86450fca871dfbfab08deb21"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#ab36e5cdf86450fca871dfbfab08deb21">empty</a> () const</td></tr>
<tr class="memdesc:ab36e5cdf86450fca871dfbfab08deb21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the buffer is empty. <br /></td></tr>
<tr class="separator:ab36e5cdf86450fca871dfbfab08deb21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a351edc682072824276baa0d40c8f84a8"><td class="memItemLeft" align="right" valign="top"><a id="a351edc682072824276baa0d40c8f84a8"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a351edc682072824276baa0d40c8f84a8">full</a> () const</td></tr>
<tr class="memdesc:a351edc682072824276baa0d40c8f84a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the buffer is full. <br /></td></tr>
<tr class="separator:a351edc682072824276baa0d40c8f84a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fd3620f0d2de8793f3a4dbd28bff5e7"><td class="memItemLeft" align="right" valign="top"><a id="a1fd3620f0d2de8793f3a4dbd28bff5e7"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html#a1fd3620f0d2de8793f3a4dbd28bff5e7">swap</a> (<a class="el" href="classtranswarp_1_1detail_1_1circular__buffer.html">circular_buffer</a> &amp;buffer)</td></tr>
<tr class="memdesc:a1fd3620f0d2de8793f3a4dbd28bff5e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swaps this buffer with the given buffer. <br /></td></tr>
<tr class="separator:a1fd3620f0d2de8793f3a4dbd28bff5e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename ValueType&gt;<br />
class transwarp::detail::circular_buffer&lt; ValueType &gt;</h3>

<p>A simple circular buffer (FIFO). ValueType must support default construction. The buffer lets you push new values onto the back and pop old values off the front. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>include/<a class="el" href="transwarp_8h_source.html">transwarp.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
